
public class Runner implements ResultListener {
	public static void main(String[] args) {
		Runner listener = new Runner();
		FirefliesResolver r = new FirefliesResolver(FlowshopData.data,
				listener, 10);
		for (int i = 0; i < 50000; i++) {
			r.iterate();
			if (i % 2000 == 0)
				System.out.printf("%d iteracja\n", i + 1);
		}
		System.out.print("Najlepsza (FF): ");
		listener.newResult(r.getFirefly(r.getBest()).getPermutation(), r.getBestTime());
		
	/*	Resolver r1 = new Resolver(FlowshopData.data, listener);
		r1.resolve();
		System.out.print("Najlepsze (PZ): ");
		listener.newResult(r1.getBest(), r1.getBestTime());*/
	}

	@Override
	public void newResult(int[] permutation, int totalTime) {
		for (int n : permutation)
			System.out.print(String.format("%d ", n + 1));	
		System.out.println(String.format(": %d", totalTime));
	}
}
